
package com.huaweicloud.haydn.delivercore.agent.common;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 功能描述
 *
 * @since 2023-03-08
 */
public class AgentConstans {

    // 涉及数据库增加、更新、删除数据以及权限变更相关的敏感词(当参考于DWS\MRS\ORACLE\MYSQL的文档，可能不全面)
    private static final String[] SQL_BAD_WORDS_LIST =
        new String[] {"CREATE", "CHANGE", "UPDATE", "DROP", "ALTER", "MODIFY", "CHANGE", "LOAD", "RENAME", "ADD",
            "INSERT", "DELETE", "TRUNCATE", "GRANT", "REVOKE", "EXP", "CLEAN", "CLOSE", "RESET", "COPY"};

    public static final Set<String> SQL_BAD_WORDS_SET = new HashSet<>(Arrays.asList(SQL_BAD_WORDS_LIST));

    @Getter
    @AllArgsConstructor
    public enum ConsistencyTypeEnum {

        // 表内容一致性检测
        TABLE_CONTENTS("consistencytablecontents"),
        // 表记录一致性检测
        TABLE_ROWS("consistencytablerows"),
        // 表字段一致性检测
        TABLE_FIELDS("consistencytablefield");

        private String consistencyType;
    }

}
